// const fs = require('fs');
// const path = require('path');
// const filePaht = path.resolve('./', './target/wasm32-unknown-unknown/release/excel_tools.wasm')
const { generate_qr_code } = require('../pkg/excel_tools')
const fs = require('fs');
// 调用 greet 函数并传递参数
const uint8Array = generate_qr_code('World fsdfa');



// 定义要写入的文件路径
const filePath = 'output.png';

// 将 Uint8Array 转换为 Buffer
const buffer = Buffer.from(uint8Array);

// 写入文件
fs.writeFile(filePath, buffer, (err) => {
  if (err) {
    console.error('Error writing file:', err);
  } else {
    console.log('File written successfully:', filePath);
  }
});
